import java.util.*;

class Student implements Comparable<Student>{
    public int compareTo(Student o){
        return 0;
    }
}
public class Test {
    public static void main(String[] args) {
        Set<String> set = new TreeSet<>();
        set.add("abc");
        set.add("abc");
        set.add("abc");
        set.add("abc");
        System.out.println(set);
    }
    public static void main1(String[] args) {

        Map<String, Integer> map = new TreeMap<>();

        map.put("abc", 10);
        map.put("hello",10);
        map.put("zijian",5);
        Set<Map.Entry<String,Integer>> entrySet = map.entrySet();
        for(Map.Entry<String,Integer> entry:entrySet){
            System.out.println("key:"+entry.getKey()+" val:"+entry.getValue());
        }
        System.out.println(map.containsKey("hell0"));
/*        Collection<Integer> list = map.values();
        System.out.println(list);

        Set<String> set = map.keySet();
        System.out.println(set);*/
/*//      若put两次的key值一样则后则会替换前者
        System.out.println(map);
//      底层为搜索树  按照key来比较大小
        System.out.println(map.get("hello"));
        System.out.println(map.getOrDefault("hellozijian",100));

        Map<Student,Integer> map1 = new TreeMap<>();
        map1.put(new Student(),1);
//      对应map来说key值不能为null*/
    }

}
